<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>Siku在线考试系统-<{$Think.config.app_name}><{$Think.config.app_copy}></title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <link rel="stylesheet" href="__ROOT__/public/static/layui/css/layui.css" media="all">
  <style>
        html, body {width: 100%;height: 100%; margin: 0;  padding: 0; background-color: #6699CC;background-image: url(__ROOT__/public/static/img/bg.jpg);}
    </style>
</head>
<body>
<div class="layui-container" style="text-align: center;position: relative;">
 
    <form class="layui-form">
    <div class="layui-card" style="width: 300px;position: absolute;top: 50%;left: 54%;transform: translate(-55%, 50%);padding: 20px;box-shadow: 0 3px 2px 0 rgba(255,255,255,0.2);padding-bottom: -20px;background-color:rgba(0,0,0,0.2)">
      <!-- <div class="layui-card-header">卡片面板</div> -->
      <div class="layui-card-body">
           <!--<h1>Tingke后台管理系统</h1>--->
          <h3><b style="color: #fff">Siku（思酷）在线考试系统</b></h3><br>
                
                  <!-- <label class="layui-form-label">输入框</label> -->
                  <div class="layui-input-inline" style="width: 260px;margin-bottom: 15px;clear: both;">
                    <input type="text" name="snumber" required  lay-verify="required" placeholder="考号" autocomplete="off" class="layui-input">
                  </div>
                
                  <!-- <label class="layui-form-label">密码框</label> -->
                  <div class="layui-input-inline" style="width: 260px;margin-bottom: 30px;clear: both;">
                    <input type="password" name="pass" required lay-verify="required" placeholder="密码" autocomplete="off" class="layui-input">
                  </div>
                <br>
              <button class="layui-btn layui-btn-fluid" lay-submit lay-filter="formdata">登录系统 </button>
          </div>
        </div>
      </form>
  
</div>
    
	

<script src="__ROOT__/public/static/layui/layui.js"></script>
<script>
//Demo
layui.use(['form','jquery'], function(){
  var form = layui.form,$ = layui.jquery;
  
  //监听提交
  form.on('submit(formdata)', function(data){
    //layer.msg(JSON.stringify(data.field));
    $.post("<{:url('login')}>",data.field,function(data,status){
          //alert(data);
          //alert(JSON.stringify(data));
          //console.log(data);
          if(data===1){
            //layer.close(index);
            layer.msg('登录成功！',{time:1000},function(){
              location.href="<{:url('index/index')}>";
            }); 
          }else{
            //layer.close(index);
            layer.alert('登录失败，请检查考号密码！',{icon:5});
          }
    })
    return false;
  });
});
</script>
</body>
</html>